﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Marbles.Web.Admin.Content
{
    public class ContentBase : System.Web.UI.UserControl
    {

        public string SiteId { get { object obj = ViewState["siteid"]; return (obj == null) ? "" : obj.ToString(); } set { ViewState["siteid"] = value; } }
        public Core.Content.Sites.SiteDefinition CurrentWeb
        {
            get
            {
                if (string.IsNullOrEmpty(this.SiteId)) { return this.Page.CurrentWeb; }
                return Core.Content.Sites.SiteDefinition.GetSiteBySiteId(this.SiteId);
            }
        }
        public Core.Content.Pages.PageDefinition CurrentPage { get { return this.Page.CurrentPage; } }

        public new Core.Pages.AdminPage Page
        {
            get { return base.Page as Core.Pages.AdminPage; }
        }

        public virtual void FirstRun()
        {
        }
    }
}